<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="index.css" />
<meta charset="UTF-8">
</head>
<body>
<?php
session_start();
$nutzer = $_SESSION['username'];	
//Übernahme vom Menü
if (!$link = mysql_connect ('localhost', 'dennis', 'dennis'))
{
	echo "Keine Verbindung zu mysql";
	
}
if (!mysql_select_db('dennis_schuelerdaten', $link))
{
	echo "konnte DB nicht finden";
}

else
{

//Name der Aktivtät
$sql="SELECT Vorname, Name, Klasse, Email FROM Schueler WHERE AktivitaetsNr is not NULL";

mysql_query("SET NAMES 'utf8'");

	//SQL-Befehl senden
	$result = mysql_query($sql,$link);
	

	// Erste Zeile holen
	echo "<table border=3 width=90%>";
		echo "<tr>";
	   echo "<th> Name </th>";
	   echo "<th> Vorname </th>"; 
	   echo "<th> Klasse </th>";
	   echo "</tr>";
	
	
	
	
	$row= mysql_fetch_assoc($result);
	while ($row != NULL)
	   {
	   

	   echo "<tr><td>";
	   echo "".$row['Name'];
	   echo "</td>";
	   echo "<td>";
	   echo "".$row['Vorname'];
	   echo "</td>";
	   echo "<td>";
	   echo "".$row['Klasse'];
	   echo "</td>";
	   echo "</tr>";
	   
	   
	  // naechste Zeile holen
		$row= mysql_fetch_assoc($result);
		
		
	  } 
echo "</table>";	  
	  }
	


?>

</body>
</html>
	
	
	
	
	
	
		
	